#include<iostream>
#include<pthread.h>
#include<cassert>
#include<unistd.h>

void *FuctionThread(void * arg)
{
   
    while(1)
    {
     
       std::cout << "我是新线程，我正在执行,我的pid：" << getpid() << std::endl;
       std::cout << (char*)arg << std::endl;
       sleep(1);
    }
}

int main()
{
   pthread_t pht;
   int n = pthread_create(&pht,nullptr,FuctionThread, (void*)"The fisrt of thread");
   assert(n == 0);

   while(1)
   {
     std::cout << "我是主线程，我正在执行,我的pid：" << getpid() << std::endl;
     sleep(1);
   }

    return 0;
}